package d4_TCP;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",4865);
        OutputStream os= socket.getOutputStream();
        //把字节输出流包装成数据输出流
        DataOutputStream dos= new DataOutputStream(os);
        dos.writeUTF("Hello World");
        dos.close();
        socket.close();
    }
}
